<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="payutil.jsp" %>
<%@include file="md5.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>To Pay</title>
<script>
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
</script>
<style> 
.tabPages{
margin-top:150px;text-align:center;display:block; border:3px solid #d9d9de; padding:30px; font-size:14px;
}
</style>
</head>
<body onLoad="document.uncome.submit()">
<div id="Content">
  <div class="tabPages">我们正在为您连接通道，请稍等......</div>
</div>
<%
    String AuthorizationURL = "http://154.91.201.233/zpay/gateway";
    String keyValue = "WOF4QHz1gDFDGLwC85xrb9qGP9bhzpFa";
    
    String transType = "1007";
    String instCode = "8001";
    String certType = "0" ;
    String certId = "EP20000001";
    String goodsDesc = request.getParameter("goodsDesc");//商户id
    String transDate = generateDate(); //yyyyMMdd
    String orderNo=generateOrderId(); //20位订单号 时间戳+6位随机字符串组成
    String backUrl="http://www.baidu.com";//通知地址
    String returnUrl="http://www.baidu.com";//回调地址
    String payType=request.getParameter("payType");
    String transAmt=request.getParameter("transAmt");
    
    String stringSignTemp="backUrl="+backUrl+"&certId="+certId+"&certType="+certType+"&goodsDesc="+goodsDesc
    		+"&instCode="+instCode+"&orderNo="+orderNo+"&payType="+payType+"&returnUrl="+returnUrl+"&transAmt="
    		+transAmt+"&transDate="+transDate+"&transType="+transType+"&key="+keyValue+"";
    String sign=md5(stringSignTemp);
%>
<form name="uncome" action="<%=AuthorizationURL%>" method="post">
    <input type="hidden" name="transType" value="<%=transType%>">
    <input type="hidden" name="instCode" value="<%=instCode%>">
    <input type="hidden" name="certType" value="<%=certType%>">
    <input type="hidden" name="certId" value="<%=certId%>">
    <input type="hidden" name="goodsDesc" value="<%=goodsDesc%>">
    <input type="hidden" name="transDate" value="<%=transDate%>">
    <input type="hidden" name="orderNo" value="<%=orderNo%>">
    <input type="hidden" name="backUrl" value="<%=backUrl%>">
    <input type="hidden" name="returnUrl" value="<%=returnUrl%>">
    <input type="hidden" name="payType" value="<%=payType%>">
    <input type="hidden" name="transAmt" value="<%=transAmt%>">
    <input type="hidden" name="sign" value="<%=sign%>">
</form>
</body>
</html>